<template>
	<view class="content-box">
		<!-- 头部navbar -->
		<navbar :fixed="true" :bgColor="'#fff'" :title="t('wallet.wdqb')" :leftIcon="true"></navbar>
		<view class="walet-form">
			<view class="form-item">
				<text>{{t('wallet.qbmc')}}</text>
				<view class="input-box">
					<input type="text" :placeholder="t('wallet.qsrqbmc')" />
				</view>
			</view>
			<view class="form-item">
				<text>{{t('wallet.qbdz')}}</text>
				<view class="input-box">
					<input type="text" :placeholder="t('wallet.qsrqbdz')" />
				</view>
			</view>
		</view>
		<view class="but-box">
			<button type="default">{{t('wallet.bc')}}</button>
		</view>
	</view>
</template>

<script setup>
	import {
		useI18n
	} from 'vue-i18n';
	import {
		ref
	} from 'vue';
	const {
		t,
		locale
	} = useI18n();

	// 是否已添加钱包
	const hasWallet = ref(false); // 设置为false显示未添加钱包状态，设置为true显示已添加钱包状态

	// 添加钱包
	const addWallet = () => {
		// 这里添加钱包的逻辑
		hasWallet.value = true;
	};

	// 编辑钱包
	const editWallet = () => {
		// 这里编辑钱包的逻辑
		uni.showToast({
			title: t('wallet.bjz'),
			icon: 'none'
		});
	};

	// 复制地址
	const copyAddress = (e) => {
		const address = e.target.innerText || e.currentTarget.innerText;
		uni.setClipboardData({
			data: address,
			success: () => {
				uni.showToast({
					title: t('common.fzcg'),
					icon: 'none'
				});
			}
		});
	};
</script>

<style scoped lang="scss">
	.content-box {
		min-height: 100vh;
		background-color: #F5F6FA;
		padding: 34.89rpx 90.70rpx;
		box-sizing: border-box;
	}

	.walet-form {
		.form-item {

			margin-bottom: 34.89rpx;

			text {
				font-size: 27.91rpx;
				font-weight: 400;
				letter-spacing: 0rpx;
				line-height: 40.42rpx;
				color: rgba(51, 51, 51, 1);
			}

			.input-box {
				input {
					height: 97.68rpx;
					opacity: 1;
					border-radius: 27.91rpx;
					border: 1.74rpx solid rgba(102, 102, 102, 1);
					margin-top: 17.45rpx;
					padding-left: 69.77rpx;
					line-height: 97.68rpx;
					color: rgba(51, 51, 51, 1);
				}

			}
		}
	}

	.but-box {
		margin-top: 146.52rpx;

		button {
			width: 570.38rpx;
			height: 97.68rpx;
			border-radius: 26.16rpx;
			background: linear-gradient(90deg, rgba(12, 193, 155, 1) 0%, rgba(91, 220, 222, 1) 29.17%, rgba(5, 145, 198, 1) 65.97%, rgba(2, 120, 220, 1) 100%);
			font-size: 31.4rpx;
			font-weight: 700;
			line-height: 97.68rpx;
			color: rgba(255, 255, 255, 1);
		}

	}
</style>